package count.negative.gerti4;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TabHost;
import android.widget.TextView;
import count.negative.gerti4.service.ProgramService;
import count.negative.gerti4.service.RtvService;

public class GertiActivity extends TabActivity {
	public ProgramService ps;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		ps = new RtvService(getApplication(), this);

		TabHost tabHost = getTabHost(); // The activity TabHost
		TabHost.TabSpec spec; // Resusable TabSpec for each tab
		Intent intent; // Reusable Intent for each tab

		// Create an Intent to launch an Activity for the tab (to be reused)
		intent = new Intent().setClass(this, JetztActivity.class);
		View view = LayoutInflater.from(tabHost.getContext()).inflate(R.layout.tabs_bg, null);
		TextView tv = (TextView) view.findViewById(R.id.tabsText);
		tv.setText("Jetzt");
		spec = tabHost.newTabSpec("Jetzt").setIndicator(view).setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, AbendActivity.class);
		view = LayoutInflater.from(tabHost.getContext()).inflate(R.layout.tabs_bg, null);
		tv = (TextView) view.findViewById(R.id.tabsText);
		tv.setText("Abend");
		spec = tabHost.newTabSpec("Abend").setIndicator(view).setContent(intent);
		tabHost.addTab(spec);

		tabHost.setCurrentTab(0);
	}
}